import { request } from '@/utils/request';
import type { MenuListResult, loginResult, DashboardResult } from '@/api/indexModel';

const Api = {
  MenuList: '/index/menu',
  UserInfoList: '/index/login',
  Dashboard: '/index/dashboard',
};

export function getMenuList() {
  return request.get<MenuListResult>({
    url: Api.MenuList,
  });
}

export function loginByUserName(data: any) {
  return request.post<loginResult>({
    url: Api.UserInfoList,
    params: data,
  });
}

export function getDashboard() {
  return request.get<DashboardResult>({
    url: Api.Dashboard,
  });
}
